import java.util.*;

/**
 * @author LKQ
 * @date 2022/6/13 22:41
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int N = sc.nextInt();
            ListNode dummy = new ListNode(0);
            ListNode cur = dummy;
            ListNode ans = null;
            for (int i = 0; i < N; i++) {
                int n = sc.nextInt();
                cur.next = new ListNode(n);
                cur = cur.next;
            }
            int k  = sc.nextInt();
            cur = dummy.next;
            for (int i = 0; i < N - k; i++) {
                cur = cur.next;
            }
            System.out.println(cur.val);
        }
    }
}
class ListNode{
    int val;
    ListNode next;
    ListNode(int val) {
        this.val = val;
    }
    ListNode(int val, ListNode next) {
        this.val = val;
        this.next = next;
    }
}
